DROP TABLE Entity
GO
CREATE TABLE [dbo].[Entity](
	[EntityID] [int] IDENTITY(1,1) NOT NULL,
	[GiftOfficer] [nvarchar](255) NULL,
	[DateJoined] [datetime] NULL,
	[ENF] [nvarchar](255) NULL,
	[SalutationHousehold] [nvarchar](255) NULL,
	[AddressSalutation] [nvarchar](255) NULL,
	[Title] [nvarchar](255) NULL,
	[CompanyName] [nvarchar](255) NULL,
	[Category] [nvarchar](255) NULL,
	[Department] [nvarchar](255) NULL,
	[NoNewsletter] [nvarchar](255) NULL,
	[Website] [nvarchar](255) NULL,
	[Origin] [nvarchar](255) NULL,
	[Notes] [nvarchar](255) NULL,
	CONSTRAINT PK_ENTITY PRIMARY KEY (EntityID)
) ON [PRIMARY]
GO


SET IDENTITY_INSERT Entity ON


	INSERT INTO dbo.Entity
			( EntityID,
			  GiftOfficer ,
			  DateJoined ,
			  ENF ,
			  SalutationHousehold ,
			  AddressSalutation ,
			  Title ,
			  CompanyName ,
			  Category ,
			  Department ,
			  NoNewsletter ,
			  Website ,
			  Origin ,
			  Notes
			)
	SELECT ID ,
			GiftOfficer ,
			DateJoined ,
			ENF ,
			SalutationHousehold ,
			AddressSalutation ,
			Title ,
			CompanyName ,
			Category ,
			Department ,
			NoNewsletter,
			Website,
			Origin,
			Notes
			FROM dbo.ImportData
			
			
			
SET IDENTITY_INSERT Entity OFF


SELECT DISTINCT Department FROM dbo.Entity